<?php
$this->breadcrumbs=array(
	'Issues'=>array('index'),
	'Check',
);

$this->menu=array(
	array('label'=>'List Issue', 'url'=>array('index')),
	array('label'=>'Create Issue', 'url'=>array('create')),
);
?>

<h1>Trang kiểm tra của trưởng nhóm giải bài tập</h1>
<?php
		$this->widget('zii.widgets.CListView', array(
		'id'=>'assign-issue-list',
		'dataProvider'=>$model->assign($ID),
		'pager'=>array
		(
			'firstPageLabel' => '&lt;&lt;',
	    'prevPageLabel'  => '&lt;',
	    'nextPageLabel'  => '&gt;',
	    'lastPageLabel'  => '&gt;&gt;',
			'header'=>'',
		),
		'emptyText'=>'Không có dữ liệu.',
		'itemView'=>'_view_check',
	)); ?>
<script type="text/javascript">
$(function() {
	$(".refresh").click(function() {
		console.log($(this));
		$(this).parent().children(".btn-success").removeAttr("disabled").removeClass("disabled");
		$(this).parent().children(".btn-inverse").removeAttr("disabled").removeClass("disabled");
	});
});


function beforeCheck(issueID,num,status) {
	var resolverID = $("#issue_"+issueID+"_"+num).val();
	$.ajax({
		url: baseUrl + "/admin/issue/setCheck",
		data: {issueID: issueID, resolverID: resolverID, status: status, num: num},
		type: "POST",//or GET
		success: function(data) {
			if(data=="success") {
				alert(data);
				$("#"+status+"_"+issueID+"_"+num).addClass("disabled").attr("disabled","disabled");
			}
		}
	});
}
</script>